<template>
  <div>
    <!-- 2.0轮播图 -->
    <div class="swipe">
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="item in imgList" :key="item.img"
          ><img :src="item.img" :alt="item.url"
        /></van-swipe-item>
      </van-swipe>
    </div>
    <tupzhong></tupzhong>
    <tabbles></tabbles>
  </div>
</template>

<script>
import { getCate } from "../apis/category";
import tupzhong from "../components/tupzhong.vue";
import tabbles from "../components/tabble.vue";
export default {
  data() {
    return {
      imgList: [],
    };
  },
  async created() {
    const res = await getCate();
    console.log(res);
    this.imgList = res.data.message;
    // console.log(this.lunbotu[0]);
  },
  components: { tupzhong, tabbles },
};
</script>

<style lang="less" scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
.my-swipe {
  height: 200px;
  img {
    height: 100%;
    width: 100%;
  }
}
</style>